﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="client.aspx.cs" Inherits="WebApplication1.client" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 291px;
        }
        #form1
        {
            height: 1px;
        }
    </style>
</head>
<body bgcolor="white">
    <form id="form1" runat="server">
    <img src="2.jpg" style="height: 197px; width: 1394px" align="centr">
    <h2 style="color: #0000FF">
        <asp:HyperLink ID="HyperLink2" runat="server" allign="left" NavigateUrl="~/Main.aspx">&lt;&lt;На главную</asp:HyperLink>
    </h2>
    <p style="color: #0000FF">
        <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
    </p>
    <p style="color: #0000FF">
        <asp:Label ID="Label5" runat="server" Text="Label"></asp:Label>
    </p>
    <h2 style="color: #0000FF">
        Выберите клиента из списка:<asp:Label ID="Label2" runat="server" Text="Label" Visible="False"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server" Visible="False">
        </asp:DropDownList>
    </h2>
    <h2>
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
            DataKeyNames="Id" DataSourceID="SqlDataSource1" Font-Size="Large" ForeColor="#000099"
            BackColor="Yellow" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" ShowSelectButton="True" />
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                    SortExpression="Id" />
                <asp:BoundField DataField="Name" HeaderText="Имя" SortExpression="Name" />
                <asp:BoundField DataField="Surname" HeaderText="Фамилия" SortExpression="Surname" />
                <asp:BoundField DataField="PassportSerial" HeaderText="Серия паспорта" SortExpression="PassportSerial" />
                <asp:BoundField DataField="PassportNumber" HeaderText="Номер паспорта" SortExpression="PassportNumber" />
                <asp:BoundField DataField="Birth" HeaderText="Дата рождения" SortExpression="Birth" />
                <asp:BoundField DataField="Phone" HeaderText="Телефон" SortExpression="Phone" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            </Columns>
            <SelectedRowStyle BackColor="#33CC33" />
        </asp:GridView>
        <asp:SqlDataSource
            ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
            DeleteCommand="DELETE FROM [Client] WHERE [Id] = @Id" 
            SelectCommand="SELECT * FROM [Client]" 
            UpdateCommand="UPDATE [Client] SET [PassportSerial] = @PassportSerial, [Birth] = @Birth, [PassportNumber] = @PassportNumber, [Name] = @Name, [Surname] = @Surname, [Phone] = @Phone, [Email] = @Email WHERE [Id] = @Id">
            <DeleteParameters>
                <asp:Parameter Name="Id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="PassportSerial" Type="Int32" />
                <asp:Parameter Name="Birth" Type="String" />
                <asp:Parameter Name="PassportNumber" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Surname" Type="String" />
                <asp:Parameter Name="Phone" Type="Int32" />
                <asp:Parameter Name="Email" Type="String" />
                <asp:Parameter Name="Id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="PassportSerial" Type="Int32" />
                <asp:Parameter Name="Birth" Type="String" />
                <asp:Parameter Name="PassportNumber" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Surname" Type="String" />
                <asp:Parameter Name="Phone" Type="Int32" />
                <asp:Parameter Name="Email" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/NewClient.aspx">Или 
        добавьте нового&gt;</asp:HyperLink>
        <asp:Label ID="LabelFinish" runat="server" Font-Size="X-Large" ForeColor="#006600" Text="Новый договор успешно добавлен!!!"
            Visible="False"></asp:Label>
    </h2>
    <asp:Panel ID="Panel1" runat="server" Height="269px" Visible="False" Width="442px">
        <table width="100%" style="height: 217px">
            <tr>
                <td class="style1" style="color: #0000FF; font-size: large; font-family: Arial;">
                    Данные об имуществе:
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Номер сертификата собственности
                </td>
                <td>
                    <asp:TextBox ID="TextBoxCertificate" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxCertificate" runat="server" ValidationExpression="[0-9]*" Display="Dynamic" ErrorMessage="Только числа"
                        ControlToValidate="TextBoxCertificate"></asp:RegularExpressionValidator>

                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxCertificate" ControlToValidate="TextBoxCertificate"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите сертификат собственности</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Адрес жилья
                </td>
                <td>
                    <asp:TextBox ID="TextBoxAddress" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxAddress" ControlToValidate="TextBoxAddress"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите адрес</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Последний этаж
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxFloor" runat="server" Text="" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Количество комнат
                </td>
                <td>
                    <asp:TextBox ID="TextBoxNumberRooms" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxNumberRooms" runat="server" ValidationExpression="[0-9]*" Display="Dynamic" ErrorMessage="Только числа"
                        ControlToValidate="TextBoxNumberRooms"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxNumberRooms" ControlToValidate="TextBoxNumberRooms"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите количество комнат</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Площадь
                </td>
                <td>
                    <asp:TextBox ID="TextBoxSqery" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxSqery" runat="server" ValidationExpression="[0-9]*" Display="Dynamic" ErrorMessage="Только числа"
                        ControlToValidate="TextBoxSqery"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxSqery" ControlToValidate="TextBoxSqery"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите площадь</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Год строительства
                </td>
                <td>
                    <asp:TextBox ID="TextBoxYear" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorTextBoxYear" runat="server" ValidationExpression="[0-9]*" Display="Dynamic" ErrorMessage="Только числа"
                        ControlToValidate="TextBoxYear"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxYear" ControlToValidate="TextBoxYear"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите год стороительства</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Стоимость имущества
                </td>
                <td>
                    <asp:TextBox ID="TextBoxPriceFlat" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator id="RegularExpressionValidatorTextBoxPriceFlat" runat="server" ValidationExpression="[0-9]*" Display="Dynamic" ErrorMessage="Только числа"
                    ControlToValidate ="TextBoxPriceFlat"
                    ></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBoxPriceFlat" ControlToValidate="TextBoxPriceFlat"
                        Display="Static" ErrorMessage="RequiredFieldValidator" runat="server"> Введите стоимость</asp:RequiredFieldValidator>
                </td>
            </tr>
        </table>
        <p style="margin-left: 360px">
            <asp:Button ID="ButtonNext1" runat="server" Text="Далее&gt;" 
                OnClick="ButtonNext1Click" Height="25px" />
        </p>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" Height="426px" Width="462px" Visible="False">
        <table style="height: 365px; width: 100%;">
            <tr>
                <td class="style1" style="color: #0000FF; font-size: large; font-family: Arial;">
                    Данные о договоре:
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Страховка от огня
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxFire" runat="server" Text="" CausesValidation="True" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Страховка от затопления
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxWater" runat="server" Text="" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Страховка от ограбления
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxRobbery" runat="server" Text="" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Проблемный договор
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxProblem" runat="server" Text="" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Включен износ
                </td>
                <td>
                    <asp:CheckBox ID="CheckBoxWear" runat="server" Text="" />
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Дата полиса
                </td>
                <td>
                    <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-size: large">
                    Стоимость полиса
                </td>
                <td>
                    <asp:TextBox ID="TextBoxPricePolis" runat="server" Enabled="False"></asp:TextBox>
                                       
                </td>
            </tr>
        </table>
        <br />
        <asp:Button ID="ButtonNext" runat="server" OnClick="ButtonNextClick" Text="Далее&gt;" />
        <asp:Button ID="ButtonPrice" runat="server" onclick="ButtonPriceClick" 
            Text="Расчитать стоимость полиса" />
        <p style="margin-left: 360px; height: 66px; width: 466px;">
            &nbsp;</p>
        <p style="margin-left: 360px; height: 66px; width: 466px;">
            &nbsp;</p>
    </asp:Panel>
    &nbsp;</form>
</body>
</html>
